import { bindable, containerless } from 'aurelia-framework';

@containerless
export class EmTaskContent {

    @bindable value;

    valueChanged(newValue, oldValue) {

    }

    _refreshSize() {
        $(this.contentRef).height($('.em-task-main').height() - $('.em-task-topbar').height() - $('.em-task-search').height());
    }

    /**
     * 当视图被附加到DOM中时被调用
     */
    attached() {

    	this._refreshSize();

        $(window).resize(_.debounce((event) => {
            this._refreshSize();
        }, 120));
    }
}
